package club.youth996.controller;


import club.youth996.entity.MallBanner;
import club.youth996.service.MallBannerService;
import club.youth996.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Zhan Xinjian
 * @since 2020-07-08
 */
@CrossOrigin
@RestController
@RequestMapping("/mallBanner")
public class MallBannerController {
    @Autowired
    MallBannerService mallBannerService;
    @RequestMapping("/getAllBanner")
    public R getAllBanner() {
        List<MallBanner> banners = mallBannerService.list();
        HashMap<String, Object> map = new HashMap<>(128);
        map.put("data", banners);
        return R.ok(map);
    }

}
